package com.wnxy.sddfp.sms.controller;

import com.wnxy.sddfp.common.result.Result;
import com.wnxy.sddfp.sms.service.SmsService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 短信服务
 */
@RestController
@RequestMapping("/sms")
public class SmsController {

    private final SmsService smsService;
    public SmsController(SmsService smsService) {
        this.smsService = smsService;
    }

    /**
     * 获取验证码
     */
    @GetMapping("/{phone}")
    public Result sendCode(@PathVariable("phone")String phone) {
        smsService.sendCode(phone);
        return Result.ok();
    }
}
